package com.shopx.auth.service;

import com.shopx.auth.DTO.LoginMngDTO;
import com.shopx.auth.DTO.RegDTO;
import com.shopx.auth.bean.SysRole;
import com.shopx.auth.bean.SysUser;
import com.shopx.auth.model.SysRoleModel;
import com.shopx.auth.model.SysUserCpModel;
import com.shopx.auth.model.SysUserModel;
import com.shopx.base.exception.ShopxException;
import com.shopx.cmm.DTO.PageDTO;
import com.shopx.config.bean.SysDict;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author lituo
 * @className: ISysUserService
 * @description: 用户
 * @date 2021/12/5 10:42 AM
 */
public interface ISysUserService {

  /**
   * 新增记录
   *
   * @param sysUser
   * @return int
   * @author lituo
   * @date 3:23 PM 2021/12/5
   */
  int insertSelective(SysUserModel sysUser) throws ShopxException;

  /**
   * @return int
   * @desc 工程管家增加用户
   * @author lituo
   * @date 2023/8/13 12:58 下午 @param sysUser
   */
  int addByMng(SysUserModel sysUser) throws ShopxException;

  /**
   * @param sysUser
   * @return int
   * @descript 注册新增用户
   * @author lituo
   * @date 2022/1/4 16:10
   */
  String regUser(SysUserModel sysUser) throws ShopxException;

  /**
   * 删除记录
   *
   * @param sysUser
   * @return int
   * @author lituo
   * @date 3:23 PM 2021/12/5
   */
  int deleteByPrimaryKey(SysUser sysUser) throws ShopxException;

  /**
   * 批量删除
   * @param list
   */
  void deleteBatch(List<SysUser> list);

  /**
   * 查询明细记录
   *
   * @param sysUser
   * @return com.shopx.auth.model.SysUserModel
   * @author lituo
   * @date 3:23 PM 2021/12/5
   */
  SysUserModel selectByPrimaryKey(SysUserModel sysUser) throws ShopxException;

  /**
   * 查询用户基本信息
   *
   * @param sysUser
   * @return
   * @auth lituo
   * @date 2022/8/12
   **/
  SysUserModel selectOne(SysUserModel sysUser) throws ShopxException;


  SysUserModel selectSimpleInfo(SysUser sysUser);

  /**
   * 修改记录
   *
   * @param sysUser
   * @return int
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  int updateByPrimaryKeySelective(SysUserModel sysUser) throws ShopxException;

  /**
   * 修改个人信息
   *
   * @param sysUser
   * @return int
   * @auth lituo
   * @date 20.7.23 2:29 下午
   **/
  int updateUserInfo(SysUser sysUser) throws ShopxException;

  /**
   * @return void
   * @desc 离职不交接
   * @author lituo
   * @date 2023/2/2 8:11 下午 @param sysUser
   */
  void quit(SysUserModel sysUser) throws ShopxException;

  /**
   * 修改身份证信息
   *
   * @param sysUser
   * @return int
   * @author lituo
   * @date 3:09 下午 2022/4/30
   */
  int updateIdCard(SysUser sysUser) throws ShopxException;

  /**
   * 修改状态
   *
   * @param sysUser
   * @return int
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  int updateState(SysUserModel sysUser) throws ShopxException;

  /**
   * 分页
   */
  PageDTO<SysUserModel> getListPage(SysUserModel sysUserModel) throws ShopxException;

  /**
   * 查询list
   *
   * @param sysUserModel
   * @return java.util.List<com.shopx.auth.model.SysUserModel>
   * @author lituo
   * @date 5:22 PM 2022/1/16
   */
  List<SysUserModel> queryList(SysUserModel sysUserModel) throws ShopxException;

  /**
   * 查询部门员工
   *
   * @param sysUserModel
   * @return java.util.List<com.shopx.auth.model.SysUserModel>
   * @author lituo
   * @date 9:21 PM 2022/2/13
   */
  List<SysUserModel> queryOrgUserList(SysUserModel sysUserModel) throws ShopxException;

  /**
   * 登录
   *
   * @param dto
   * @return com.shopx.auth.model.SysUserModel
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  SysUserModel officeLogin(LoginMngDTO dto) throws ShopxException;

  /**
   * 切换公司
   *
   * @param cpId
   * @return void
   * @auth lituo
   * @date 24.5.23 6:10 下午
   **/
  SysUserModel changeCp(String cpId) throws ShopxException;

  /**
   * @return java.lang.String
   * @desc 切换角色
   * @author lituo
   * @date 2023/7/18 10:36 下午 @param roleCode
   */
  String changeRoleType(String roleCode) throws ShopxException;

  /**
   * 查询用户信息
   *
   * @param sysUserModel
   * @return com.shopx.auth.model.SysUserModel
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  SysUserModel selectUser(SysUserModel sysUserModel) throws ShopxException;

  /**
   * 修改密码
   *
   * @param userModel
   * @return void
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  void changePswd(SysUserModel userModel) throws ShopxException;

  /**
   * 管理员修改密码
   *
   * @param userModel
   * @return void
   * @author lituo
   * @date 4:05 下午 2022/4/30
   */
  void changePswdByAdmin(SysUserModel userModel) throws ShopxException;

  /**
   * 根据角色查询用户
   *
   * @param sysUser
   * @return java.util.List<com.shopx.auth.model.SysUserModel>
   * @author lituo
   * @date 3:24 PM 2021/12/5
   */
  List<SysUserModel> selectListByRoleCode(SysUserModel sysUser) throws ShopxException;

  /**
   * 用户注册
   *
   * @param regDTO
   * @return void
   * @author lituo
   * @date 1:23 PM 2021/12/10
   */
  void userReg(RegDTO regDTO);

  /**
   * @param filePath
   * @return void
   * @descript 批量写入用户数据
   * @author lituo
   * @date 2021/12/21 16:37
   */
  void batchWriteUser(String filePath);

  /**
   * 查询当前登录用户组织机构编号
   *
   * @param
   * @return java.lang.String
   * @author lituo
   * @date 8:45 PM 2021/12/27
   */
//  String getCurUserOrgId();

  /**
   * 获取当前登录的用户信息
   *
   * @param
   * @return com.shopx.auth.model.SysUserModel
   * @author lituo
   * @date 8:51 PM 2021/12/27
   */
  SysUserModel getCurUserInfo();

  /**
   * @param userId
   * @return boolean
   * @descript 验证用户是否属于店铺活施工部
   * @author lituo
   * @date 2022/3/7 16:18
   */
  List<SysRole> chkUserSOFlag(String userId);

  /**
   * @return java.util.List<com.shopx.auth.model.SysUserCpModel>
   * @desc 查询用户的公司列表
   * @author lituo
   * @date 2023/5/23 10:33 下午 @param loginMngDTO
   */
  List<SysUserCpModel> selectUserCpList(LoginMngDTO loginMngDTO);

  /**
   * @return java.util.List<com.shopx.auth.model.SysUserModel>
   * @desc 根据角色类型查询用户
   * @author lituo
   * @date 2023/8/13 10:53 上午 @param sysUser
   */
  List<SysUserModel> selectListByRoleType(SysUserModel sysUser);

  /**
   * @desc 获取验证码
   * @author lituo
   * @date 2024/5/3 10:00 下午 @param sysUser
   * @return String
   */
  String createRegCode(SysUser sysUser);
}

